<template>
	<view class="contract-list-container">
		<view class="" v-if="list.length">
		<contraList v-for="item in list" :key="item.id" :contract="item"></contraList>
		</view>
		<Empty v-else></Empty>
	</view>
</template>

<script>
	import {
		getContratList
	} from '@/api/app.js'
	import contraList from '@/components/contratList/index.vue'
	import Empty from '@/components/empty/index.vue'
	export default {
		components:{contraList,Empty},
		data() {
			return {
				list:[]
			}
		},
		onLoad() {
			this.getContratList()
		},
		methods: {
			// 获取列表
			async getContratList() {
				const id = uni.getStorageSync('id')
				const res = await getContratList({id})
				this.list = res.data
			}
		}
	}
</script>

<style scoped lang="scss">
	.contract-list-container{
		padding: 20rpx;
	}
</style>